package com.study.mall.basic;

import org.junit.jupiter.api.Test;

import java.util.HashSet;
import java.util.Set;

public class Demo {

    @Test
    public void test1() {
        Student s1 = new Student(1, "zhangsan1", 23);
        Student s2 = new Student(2, "zhangsan2", 23);
        Student s3 = new Student(1, "zhangsan1", 25);
        Set<Student> set = new HashSet<>();
        set.add(s1);
        set.add(s2);
        set.add(s3);
        for (Student student : set) {
            System.out.println(student);
        }
    }

    public static void main(String[] args) {
        Person p1 = new Person(18);
        Person p2 = p1.clone();
        p2.age = 20;
        p2.arr[0] = 10;

        System.out.println(p1 == p2);//false
        System.out.println(p1.age);//18
        System.out.println(p1.arr[0]);//10
    }
}
